﻿namespace TestTool.Tests.Common.TestEngine
{
    using System;
    using System.Threading;
    using TestTool.HttpTransport.Interfaces;
    using TestTool.Tests.Definitions.Exceptions;

    public class TestSemaphore : IExecutionController, ITransportController, IChannelController
    {
        private AutoResetEvent _stopEvent = new AutoResetEvent(false);

        public void ReportStop()
        {
            throw new StopEventException();
        }

        public void Stop()
        {
            this._stopEvent.Set();
        }

        public WaitHandle StopEvent
        {
            get
            {
                return this._stopEvent;
            }
        }
    }
}

